﻿// ****************************************************************************** //
//                       Module that updates all the game logic                   //
// ****************************************************************************** //

module GameLogicUpdate

open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Input
open Microsoft.Xna.Framework.Graphics
open CarsSimulation
open FrogSimulation
open RiverSimulation
open FrogTypes
open WinLogic
open Utilities
open Casanova
open Coroutines
open Math
open SI


let mutable private update_cars_state =
    repeat_ (spawn_cars ())

let mutable private update_frog_state =
    repeat_ (update_frog ())

let mutable private update_river_state =
    repeat_ (spawn_trunks ())

let mutable private update_river_state2 =
    repeat_ (spawn_leafs ())


let update_script() =
    update_cars_state <- update_ai update_cars_state
    update_river_state <- update_ai update_river_state
    update_river_state2 <- update_ai update_river_state2
